<template>
  <div>
    <h2>子页面</h2>
    <!-- <a-button type="danger" @click="back">返回</a-button> -->
    <a-table :columns="columns" :data-source="tableData" bordered>
    <a slot="name" slot-scope="text">{{ text }}</a>
    <template slot="action" slot-scope="record">
      <a-button type="primary" style="margin-right: 10px" @click="Del(record)">删除</a-button>
      <a-button type="primary" @click="edit(record)">修改</a-button>
    </template>
  </a-table>
  </div>
</template>

<script>
export default {
  name: 'testPage',
  props:{
    columns:Array,
    tableData:Array
  },
  data(){
    return{

    }
  },
  methods:{
    back(){
      this.$router.push('/main')
    },
    Del(record){
      this.$emit('handleDel', record)
    },
    edit(record){
      this.$emit('handleEdit', record)
    }
  }
}
</script>

<style>

</style>